package cn.ciis.sys.taxonomy;

import cn.ciis.basic.base.BaseValidator;
import com.jfinal.core.Controller;

/**
 * AccountUpdateValidator 验证角色修改功能表单
 *
 * @author 冉志林
 */
public class TaxonomyAdminValidator extends BaseValidator {

  @Override
  protected void validate(Controller c) {
    setShortCircuit(true);

    validateRequiredString("taxonomy.name", "msg", "名称不能为空");
    validateRequiredString("taxonomy.identification", "msg", "标识不能为空");
  }

  @Override
  protected void handleError(Controller c) {
    c.setAttr("state", "fail");
    c.renderJson();
  }
}
